package com.ruicar.afs.cloud.apply.archive.controller;

import com.ruicar.afs.cloud.apply.archive.condition.ImageCondition;
import com.ruicar.afs.cloud.apply.archive.condition.MoreProducttCondition;
import com.ruicar.afs.cloud.apply.archive.service.MoreProductService;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 多品接口
 * @author: yaorui.zhang
 * @date: 2020年8月4日 14:28:44
 */
@AllArgsConstructor
@RestController
@RequestMapping("/moreProduct")
public class MoreProductController {

    private MoreProductService moreProductService;

    /**
     * 多品归档编辑和查看页面
     * @param condition
     * @return
     */
    @ApiOperation("多品归档编辑和查看页面")
    @PostMapping("/editview")
    public IResponse editview(@RequestBody MoreProducttCondition condition) {
        return moreProductService.editview(condition);
    }

    /**
     * 多品获取邮单列表
     * @param condition
     * @return
     */
    @ApiOperation("多品获取邮单列表")
    @PostMapping("/getlist")
    public IResponse getlist(@RequestBody MoreProducttCondition condition) {
        return moreProductService.getlist(condition);
    }

    /**
     * 多品获取邮单详情
     * @param condition
     * @return
     */
    @ApiOperation("多品获取邮单详情")
    @PostMapping("/getdetail")
    public IResponse getdetail(@RequestBody MoreProducttCondition condition) {
        return moreProductService.getdetail(condition);
    }

    /**
     * 档案系统用到的各种数据字典的接口
     * @param condition
     * @return
     */
    @ApiOperation("档案系统用到的各种数据字典的接口")
    @PostMapping("/getcodes")
    public IResponse getcodes(@RequestBody MoreProducttCondition condition) {
        return moreProductService.getcodes(condition);
    }

    /**
     * 从fms库删除影像件
     * @param condition
     * @return
     */
    @ApiOperation("从fms库删除影像件")
    @PostMapping("/delImageFormFms")
    public IResponse delImageFormFms(@RequestBody ImageCondition condition) {
        return moreProductService.delImageFormFms(condition);
    }

    /**
     * 影像件上传后保存业务数据
     * @param condition
     * @return
     */
    @ApiOperation("影像件上传后保存业务数据")
    @PostMapping("/dcsaveinfo")
    public IResponse dcsaveinfo(@RequestBody ImageCondition condition) {
        return moreProductService.dcsaveinfo(condition);
    }

}
